﻿using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Durable.DControl
{
   public  class WaveControl
    {
        public void LoadPicone(System.Windows.Forms.PictureBox picture)
        {
            picture.Image = Image.FromFile(Application.StartupPath+ "/Images/flow.bmp");

        }
        public void draw(System.Windows.Forms.PictureBox picture)
        {

            // 1211  533
            int y1 = 0;
            int y2 = 0;

            for (int i = 490; i >= 0; i -= 10)
            {
                y1 = i;
                y2 = 500;


                int x = 0;
                x = 33;
                Graphics g = picture.CreateGraphics();
                g.DrawLine(new Pen(Color.LightGreen, 2), x, y1, x, y2);
                SolidBrush mysbrush1 = new SolidBrush(Color.DarkOrchid);

                g.DrawString(picture.Width.ToString() + "-" + picture.Height.ToString(), new Font("宋体", 12, FontStyle.Bold), mysbrush1, 30, 500);
                //picture.Update();//这句话相当关键  会是消除之前画的图 速度加快
                g.Dispose();

                System.Threading.Thread.Sleep(1000);
            }
            picture.Update();
           //picture.Refresh();
        }
        


    }
}
